/*
 * player.h
 *
 *  Created on: 15 nov. 2010
 *      Author: Nicolas Aucouturier, Laurent R�veill�re
 */

#ifndef PLAYER_H_
#define PLAYER_H_

#include <stdio.h>
#include <stdlib.h>
#include <SDL.h>
#include <SDL_image.h>

#include "../include/constant.h"
#include "../include/map.h"
#include "../include/monster.h"
#include "../include/monster_list.h"

enum e_way {
	NORTH = 0, SOUTH, WEST, EAST
};

typedef struct s_player * t_player;
typedef struct s_map* t_map;
typedef struct monster_list *t_monster_list;

// Creates a new player with a given number of available bombs and number of life
extern t_player player_init(int bomb_number, int nb_life, int bomb_range);

// Free memory that used the player
extern void player_free(t_player player);

// Returns the current position of the player
extern int player_get_x(t_player player);
extern int player_get_y(t_player player);

// Set the direction of the next move of the player
extern void player_set_current_way(t_player player, enum e_way way);

//Returns the bomb power
extern int player_get_bomb_range(t_player player);

//Decrease and increase the bomb power
extern void player_dec_bomb_range(t_player player);
extern void player_inc_bomb_range(t_player player);

// Get, Increase, Decrease the number of bomb that player can put
extern int player_get_nb_bomb(t_player player);
extern void player_inc_nb_bomb(t_player player);
extern void player_dec_nb_bomb(t_player player);

//Get, Increase, Decrease the number of player lives
extern int player_get_nb_life(t_player player);
extern void player_inc_nb_life(t_player player);
extern void player_dec_nb_life(SDL_Surface * screen, t_player player);

//check if the player has lost
extern void player_gameover_display(SDL_Surface * screen, t_player player);
//check if the player has to be decreased
extern void player_life_display(int x, int y, t_player player,
		SDL_Surface * screen);

//Returns the player's has_goal
extern int player_has_goal(t_player player);
//Returns the player's has_won
extern int player_has_won(t_player player);

//will display the victory picture
extern void player_victory_display(SDL_Surface * screen, t_player player);

//Decrease the player's has_goal
extern void player_dec_has_goal(t_player player);

//Returns the player's has_reached_gate
extern int player_has_reached_gate(t_player player);

//decrease the player's has_reached_gate
extern void player_dec_reached_gate(t_player player);
// Load the player position from the map
extern void player_from_map(t_player player, t_map map);

// Move the player according to the current direction
extern int player_move(t_player player, t_map map,SDL_Surface *screen);

// Display the player on the screen
extern void player_display(t_player player, SDL_Surface *screen);

//Returns the player's has_key
extern int player_has_key(t_player player);

#endif /* PLAYER_H_ */
